import java.awt.*;

public class GameObj {
    //物体的坐标
    int x;
    int y;
    int width = 30;
    int height = 30;
    Image img;
    //窗口对象的引用
    GameFrame frame;

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public Image getImg() {
        return img;
    }

    public void setImg(Image img) {
        this.img = img;
    }

    //空构造函数
    public GameObj() {
    }
    //没有物体宽和高的构造函数
    public GameObj(int x, int y, Image img, GameFrame frame) {
        this.x = x;
        this.y = y;
        this.img = img;
        this.frame = frame;
    }

    //绘制物体自身的方法
    public void paintSelf(Graphics graphics){
        graphics.drawImage(img,x,y,null);
    }
}
